<template>
  <div class="big-screen">
    <!-- 顶部图片 -->
    <div class="home-top"></div>
    <!-- 底部图片 -->
    <!-- <div class="home-bottom" @click="goHome"></div> -->
    <!-- 中间的内容 -->
    <div class="content_left">
      <div class="content_left_top">
        <div class="patient-risk-title">
          <div class="blue_block"></div><div>患者危险性占比</div></div
        >
        <div class="progress">
          <div class="progress-item">
            <div class="progress-title">
              <div class="crown1"></div>
              <div class="progress-description">
                {{ riskProportion.firstHospitalName }}
              </div>
            </div>
            <div class="progress-bar">
              <div class="progress-fill">
                <PercentBar
                  :value="riskProportion.firstCount"
                  :max="total"
                  :bar-background="'linear-gradient(to right, #00318A 0%, #37FFB8 100%)'"
                />
              </div>
              <div class="progress-number">{{ riskProportion.firstCount || 0 }}人</div>
            </div>
          </div>
          <div class="progress-item">
            <div class="progress-title">
              <div class="crown2"></div>
              <div class="progress-description">
                {{ riskProportion.secondHospitalName }}
              </div>
            </div>
            <div class="progress-bar">
              <div class="progress-fill">
                <PercentBar
                  :value="riskProportion.secondCount"
                  :max="total"
                  :bar-background="'linear-gradient(to right, #00318A 0%, #37FFB8 100%)'"
                />
              </div>
              <div class="progress-number">{{ riskProportion.secondCount || 0 }}人</div>
            </div>
          </div>
          <div class="progress-item">
            <div class="progress-title">
              <div class="crown3"></div>
              <div class="progress-description">
                {{ riskProportion.thirdHospitalName }}
              </div>
            </div>
            <div class="progress-bar">
              <!-- 进度条 -->
              <div class="progress-fill">
                <PercentBar
                  :value="riskProportion.thirdCount"
                  :max="total"
                  :bar-background="'linear-gradient(to right, #00318A 0%, #37FFB8 100%)'"
                />
              </div>
              <div class="progress-number">{{ riskProportion.thirdCount || 0 }}人</div>
            </div>
          </div>
        </div>
        <div class="pie-bg"></div>
        <div id="pie-chart" class="pie-chart"></div>
      </div>
      <div class="content_left_bottom">
        <div class="patient-risk-title">
          <div class="blue_block"></div>
          <div>新增患者数量</div>
        </div>
        <div id="recent-three-add-chart" class="recent-three-add-chart"></div>
      </div>
    </div>
    <div class="content_middle">
      <div class="map_content">
        <div class="top_map">
                  <div>
          <div class="time-box">
    
              <div
              :class="timeParams.timeType === '01' ? 'time-active' : 'time-bg'"
              @click="timeParams.timeType = '01'"
              >日</div
            >
            <div
              :class="timeParams.timeType === '02' ? 'time-active' : 'time-bg'"
              @click="timeParams.timeType = '02'"
              >月</div
            >
            <div
              :class="timeParams.timeType === '03' ? 'time-active' : 'time-bg'"
              @click="timeParams.timeType = '03'"
              >年</div
            >
          </div>
          <div class="patient_total">患者总数：<span class="patient_total_number">{{allTotal}}</span>人</div>
            </div>
          <div class="map_name"
            >{{ regionName }}<div v-show="showBack" class="goback" @click="goback"></div
          ></div>
          <div class="go_home" @click="goHome">主页</div>
        </div>
        <!-- 地图  -->
        <div id="map-chart" class="map-chart"></div>
        <div class="middle_bottom">
          <div class="map_data_display">
            <div class="patient-alarm-title">
              <div class="patient-alarm-title-right">
                <div class="blue_block"></div>
                <div>精神病患者排查鉴定情况</div>
              </div>
            </div>
            <div class="map_data_content">
              <div class="map_data_item">
                <div class="checking_icon"></div>
                <div class="map_text">
                  <div
                    ><span class="map_number">{{ checkPatients.newPatientsCount || 0 }}</span
                    >人</div
                  >
                  <div>排查新增人数</div>
                </div>
              </div>
              <div class="map_data_item">
                <div class="confirm_icon"></div>
                <div class="map_text">
                  <div
                    ><span class="map_number">{{
                      checkPatients.identifiedNewPatientsCount || 0
                    }}</span
                    >人</div
                  >
                  <div>鉴定新增人数</div>
                </div>
              </div>
              <div class="map_data_item">
                <div class="patient_icon"></div>
                <div class="map_text">
                  <div
                    ><span class="map_number">{{
                      checkPatients.newIdentifiedPatientsCount || 0
                    }}</span
                    >人</div
                  >
                  <div>患者新增人数</div>
                </div>
              </div>
            </div>
          </div>
          <div class="random_rate">
            <div class="random_rate_text">面访率</div>
            <div class="random_rate_number">{{ randomRate * 100 }}%</div>
          </div>
        </div>
      </div>
    </div>
    <div class="content_right">
      <div class="content_right_top">
        <div class="patient-risk-title">
          <div class="blue_block"></div>
          <div>新增高风险人员数量</div>
        </div>
        <div id="hight-risk-chart" class="hight-risk-chart"></div>
      </div>
      <div class="content_right_middle">
        <div class="patient-risk-title">
          <div class="blue_block"></div>
          <div>随访情况</div>
        </div>
        <div id="random-chart" class="random-chart"></div>
      </div>
      <div class="content_right_bottom">
        <div class="patient-risk-title">
          <div class="blue_block"></div>
          <div>疑似严重精神障碍患者排查情况</div>
        </div>
        <div id="cure-rate-list" class="cure-rate-list"> </div>
      </div>
    </div>
  </div>
</template>
<script lang="ts" setup>
import {
  getPie3D,
  getBarChartOption,
  getBarAndLineChartOption,
  getLineChartOption,
  getMapOption,
  getNegativeLineOption
} from './3DCharts'
import * as BigScreenApi from '@/api/patient/bigScreen'
import { formatDate } from '@/utils/formatTime'
import { da } from 'element-plus/es/locale'
import { DICT_TYPE, getIntDictOptions } from '@/utils/dict'
import { geoJsonData } from './geoJson/geoJson'
import { getUserForm } from '@/utils/auth'
defineOptions({ name: 'BigScreen' })
const deptList = getIntDictOptions(DICT_TYPE.AREA_CODE)
const echarts = getCurrentInstance()!.appContext.config.globalProperties.$echarts

// const queryParams = ref({
//   pageNo: 1,
//   pageSize: 10
// })

// const cureTotal = ref(0)
// const cureLists = ref([])
// const cureTop = ref({})
const timeParams = ref({
  timeType: '01',
  deptId: undefined
})
//监听timeParams，如果变化调用getProportion,initPie3D,initBar3D,initTwoLine3D,initLine3D接口
watch(
  () => timeParams.value,
  () => {
    getProportion()
    initPie3D()
    initBar3D()
    initNegativeLineOption()
    initTwoLine3D()
    initLine3D()
    getCheckPatients()
  },
  { deep: true }
)
const checkPatients = ref({})
const getCheckPatients = async () => {
  checkPatients.value = await BigScreenApi.getCheckPatientsCount(timeParams.value)
  randomRate.value = await BigScreenApi.getPatientFaceVisitRate(timeParams.value)
}

const riskProportion = ref({})
const randomRate = ref(0)
const total = ref(100)
const allTotal=ref(0)
const getProportion = async () => {
  const data = await BigScreenApi.getRiskProportion(timeParams.value)
  total.value = data.firstCount + data.secondCount + data.thirdCount
  allTotal.value=data.total
  riskProportion.value = data
}

const initPie3D = async () => {
  const data = await BigScreenApi.getRiskTypeProportion(timeParams.value)
  const pieData = []
  data?.forEach((element) => {
    pieData.push({
      name: element.riskTypeName,
      value: element.riskTypeCount
    })
  })
  const pieChart = document.getElementById('pie-chart')
  if (pieChart) {
    const option = getPie3D(pieData, 0)
    const pieChartInstance = echarts.init(pieChart)
    pieChartInstance.setOption(option)
    window.addEventListener('resize', () => {
      pieChartInstance.resize()
    })
  }
}

const initBar3D = async () => {
  const data = await BigScreenApi.getIncreaseProportion(timeParams.value)
  const barData = [
    {
      name: '新增',
      data: []
    }
  ]
  data?.forEach((element) => {
    barData[0].data.push({
      name: element.increaseTime,
      value: element.increaseCount
    })
  })
  const barChart = document.getElementById('recent-three-add-chart')
  if (barChart) {
    const option = getBarChartOption(barData)
    const barChartInstance = echarts.init(barChart)
    barChartInstance.setOption(option)
    window.addEventListener('resize', () => {
      barChartInstance.resize()
    })
  }
}
const initTwoLine3D = async () => {
  const data = await BigScreenApi.getFollowUpTrends(timeParams.value)
  const xLabel = []
  const lineData = []
  const barData = []
  data?.forEach((element) => {
    xLabel.push(element.month)
    lineData.push(element.phoneCount)
    barData.push(element.faceCount)
  })
  const barAndLineChart = document.getElementById('random-chart')
  if (barAndLineChart) {
    const option = getBarAndLineChartOption(barData, lineData, xLabel)
    const barAndLineChartInstance = echarts.init(barAndLineChart)
    barAndLineChartInstance.setOption(option)
    window.addEventListener('resize', () => {
      barAndLineChartInstance.resize()
    })
  }
}

const initLine3D = async () => {
  const xLabel = []
  const lineData = []
  const data = await BigScreenApi.getHighRiskPatients(timeParams.value)
  data?.forEach((element) => {
    xLabel.push(element.month)
    lineData.push(element.count)
  })
  const lineChart = document.getElementById('hight-risk-chart')
  if (lineChart) {
    const option = getLineChartOption(xLabel, lineData, '人数')
    const lineChartInstance = echarts.init(lineChart)
    lineChartInstance.setOption(option)
    window.addEventListener('resize', () => {
      lineChartInstance.resize()
    })
  }
}

const initNegativeLineOption = async () => {
  const seriesData = []
  const data = await BigScreenApi.getSuspectedMentalDisorder(timeParams.value)
  data?.detail?.forEach((element) => {
    seriesData.push({
      name:element.deptName,
      value:element.suspectedMentalDisorderCount
    })
  })
  const negLineChart = document.getElementById('cure-rate-list')
  if (negLineChart) {
    const option = getNegativeLineOption(seriesData)
    const negLineChartInstance = echarts.init(negLineChart)
    negLineChartInstance.setOption(option)
    window.addEventListener('resize', () => {
      negLineChartInstance.resize()
    })
  }
}

const regionName = ref('驻马店市')
const perRegionName = ref('')
//是否显示返回按钮
const showBack = ref(false)
const showLable = ref(true)
const selectedRegions = ref<string[]>([]) // 存储选中的区域
let mapChartInstance = null
//初始化地图
const initMap3D = async () => {
  const deptId = getUserForm().user.deptId
  const mapDept = deptList.find((dept) => dept.value === deptId)
  regionName.value = mapDept?.label
  const mapChart = document.getElementById('map-chart')
  if (mapChart) {
    if (mapDept?.label === '驻马店市') {
      showLable.value = true
    } else {
      perRegionName.value = mapDept?.label
      showLable.value = false
    }
    const option = getMapOption(showLable.value, geoJsonData(mapDept?.label))
    mapChartInstance = echarts.init(mapChart)
    mapChartInstance.setOption(option)
    mapChartInstance.on('click', function (params) {
      // 可以执行跳转、弹窗、详细面板展示等
      if (params.componentType === 'geo') {
        const clickOption = mapChartInstance.getOption()
        //如果是市地图，下探，如果是乡镇地图，选中
        if (regionName.value === '驻马店市') {
          regionName.value = params.name
          perRegionName.value = params.name
          const selectedDept = deptList.find((dept) => dept.label === regionName.value)
          timeParams.value.deptId = selectedDept ? selectedDept.value : undefined
          echarts.registerMap('zhumadian', geoJsonData(params.name) as any)
          //禁用lable默认显示,进入乡镇不显示
          showMapLable(false, clickOption)
        } else {
          regionName.value = params.name
          // 单选逻辑：清空选中区域，只保留当前点击的区域
          if (!selectedRegions.value.includes(regionName.value)) {
            selectedRegions.value = [regionName.value]
            //通过regionName取出deptList的value赋值给timeParams.deptId
            const selectedDept = deptList.find((dept) => dept.label === regionName.value)
            timeParams.value.deptId = selectedDept ? selectedDept.value : undefined
          } else {
            selectedRegions.value = []
            regionName.value = perRegionName.value
            const selectedDept = deptList.find((dept) => dept.label === regionName.value)
            timeParams.value.deptId = selectedDept ? selectedDept.value : undefined
          }
          // 更新地图选中状态
          updateMapRegions(mapChartInstance, clickOption)
        }
        // 重新设置地图配置
        mapChartInstance.setOption(clickOption)
      }
    })
    window.addEventListener('resize', () => {
      mapChartInstance.resize()
    })
  }
}
//返回上级地图
const goback = () => {
  showBack.value = false
  regionName.value = '驻马店市'
  const selectedDept = deptList.find((dept) => dept.label === regionName.value)
  timeParams.value.deptId = selectedDept ? selectedDept.value : undefined
  echarts.registerMap('zhumadian', geoJsonData('驻马店市') as any)
  const clickOption = mapChartInstance.getOption()
  //清空选中状态
  clickOption.geo[0].regions = []
  showMapLable(true, clickOption)
  // 重新设置地图配置
  mapChartInstance.setOption(clickOption)
}
//是否默认显示lable
const showMapLable = (isShowLable: boolean, option: any) => {
  // 更新 `regions` 属性，设置选中区域的样式
  showBack.value = !isShowLable
  option.geo[0].emphasis.label.show = !isShowLable
  option.series[0].label.show = isShowLable
}
// 更新地图选中状态
const updateMapRegions = (mapChartInstance: any, option: any) => {
  // 更新 `regions` 属性，设置选中区域的样式
  option.geo[0].regions = selectedRegions.value.map((region) => ({
    name: region,
    itemStyle: {
      areaColor: {
        type: 'radial',
        x: 0.5,
        y: 0.5,
        r: 0.8,
        colorStops: [
          { offset: 0, color: 'transparent' }, // 中心颜色
          { offset: 1, color: '#59eefc' } // 边缘颜色
        ],
        global: false
      },
      borderWidth: 2, // 高亮时的边框宽度
      borderColor: '#59eefc' // 高亮时的边框颜色
    }
  }))
}

const goHome = () => {
  // 新页面打开大屏可视化
  window.open('/baseInfo', '_blank')
}

//无限滚动接口
// const load = () => {
//   // 判断是否还有更多数据需要加载
//   if (queryParams.value.pageNo * queryParams.value.pageSize < cureTotal.value) {
//     // 当前页数加1，调getCureList接口
//     queryParams.value.pageNo += 1
//     getCureList()
//   }
// }

//挂载时候加载
onMounted(() => {
  getProportion()
  initMap3D()
  // getCureList()
  initNegativeLineOption()
  getCheckPatients()
  initPie3D()
  initBar3D()
  initTwoLine3D()
  initLine3D()
})
</script>
<style lang="scss" scoped>
.big-screen {
  width: 100%;
  height: 100%;
  display: flex;
  justify-content: space-around;
  align-items: center;
  background-image: url('@/assets/patient/home/home-bg.png');
  background-size: 100% 100%;
  background-repeat: no-repeat;
  //加一个蒙版层
  &::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
  }
}
.home-top {
  width: 100%;
  height: 119px;
  position: absolute;
  top: 0;
  left: 0;
  background-image: url('@/assets/patient/home/home-top.png');
  background-size: 100% 100%;
  background-repeat: no-repeat;
  //在中间添加文字"数据分析"
  &::after {
    content: '驻马店市严重精神障碍患者服务管理系统';
    position: absolute;
    top: 60%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 22px;
    color: #fff;
    font-weight: bold;
  }
}
.home-bottom {
  width: 1063px;
  height: 71px;
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  background-image: url('@/assets/patient/home/home-bottom.png');
  background-size: 100% 100%;
  background-repeat: no-repeat;
  cursor: pointer;
  //在中间添加文字
  &::after {
    content: '主页';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 20px;
    color: #ffffff88;
    font-weight: bold;
  }
  //移入动画
  &:hover {
    //放大
    transform: translateX(-50%) scale(1.05);
    //平滑过渡
    transition: transform 0.3s ease-in-out;
  }
}
.content_left {
  width: 463px;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 10px;
  .content_left_top {
    width: 100%;
    height: 410px;
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: center;
    background-image: url('@/assets/patient/home/content-bg.png');
    background-size: 100% 100%;
    background-repeat: no-repeat;
    .progress {
      width: 100%;
      height: 140px;
      padding: 10px 20px;
      margin: 5px 0 5px 0;
      display: flex;
      flex-direction: column;
      justify-content: space-between;
      align-items: center;
    }
    .pie-chart {
      width: 100%;
      height: 225px;
      background-image: url('@/assets/patient/home/pieChart-bg.png');
      background-size: 80% 100%;
      background-repeat: no-repeat;
      background-position: center;
      //添加一个透明高亮背景
      // &::before {
      //   content: '';
      //   position: absolute;
      //   top: 0;
      //   left: 32%;
      //   width: 171px;
      //   height: 148px;
      //   //从上到下从透明渐变成#D8DFF1
      //   background: linear-gradient(to bottom, transparent 0%, #083588 100%);
      // }
    }
  }
  .content_left_bottom {
    width: 100%;
    height: 395px;
    position: relative;
    background-image: url('@/assets/patient/home/content-bg.png');
    background-size: 100% 100%;
    background-repeat: no-repeat;
  }
}
.content_middle {
  width: 900px;
  height: 100%;
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}
.map_content {
  width: 100%;
  height: 87%;
  padding: 10px 0;
  position: relative;
}
.content_right {
  width: 463px;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 10px;
  .content_right_top {
    width: 100%;
    height: 195px;
    position: relative;
    background-image: url('@/assets/patient/home/content-bg.png');
    background-size: 100% 100%;
    background-repeat: no-repeat;
  }
  .content_right_middle {
    width: 100%;
    height: 230px;
    position: relative;
    background-image: url('@/assets/patient/home/content-bg.png');
    background-size: 100% 100%;
    background-repeat: no-repeat;
  }
  .content_right_bottom {
    width: 100%;
    height: 380px;
    position: relative;
    background-image: url('@/assets/patient/home/content-bg.png');
    background-size: 100% 100%;
    background-repeat: no-repeat;
  }
}
.blue_block {
  width: 10px;
  height: 10px;
  background: #48a2fc;
  border-radius: 2px;
}
.patient-risk-title {
  width: 100%;
  height: 36px;
  position: relative;
  top: 0;
  left: 0;
  font-size: 20px;
  color: #fff;
  font-weight: bold;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 5px;
  padding-left: 10px;
  background-image: url('@/assets/patient/home/content-title-bg.png');
  background-size: 100% 100%;
  background-repeat: no-repeat;
}
.patient-alarm-title {
  width: 100%;
  height: 40px;
  position: relative;
  top: 0;
  left: 0;
  display: flex;
  justify-content: space-between;
  padding: 0 20px;
  background-image: url('@/assets/patient/home/alarm-timing.png');
  background-size: 100% 100%;
  background-repeat: no-repeat;
}
.patient-alarm-title-right {
  width: 60%;
  height: 40px;
  font-size: 20px;
  color: #fff;
  font-weight: bold;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 5px;
}
.progress-title {
  width: 100%;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 5px;
}
.crown1 {
  width: 20px;
  height: 20px;
  background-image: url('@/assets/patient/home/crown1.png');
  background-size: 100% 100%;
  background-repeat: no-repeat;
}
.crown2 {
  width: 20px;
  height: 20px;
  background-image: url('@/assets/patient/home/crown2.png');
  background-size: 100% 100%;
  background-repeat: no-repeat;
}
.crown3 {
  width: 20px;
  height: 20px;
  background-image: url('@/assets/patient/home/crown3.png');
  background-size: 100% 100%;
  background-repeat: no-repeat;
}
.progress-bar {
  width: 100%;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 5px;
}
.progress-fill {
  width: 85%;
  height: 100%;
}
.progress-item {
  width: 100%;
}
.progress-description {
  color: #fff;
  font-family: MiroSoft YaHei;
  font-size: 14px;
  font-weight: bold;
}
.progress-number {
  height: 20px;
  font-weight: 400;
  color: #ccc;
  font-family: MiroSoft YaHei;
  font-size: 14px;
  //文字居中
  line-height: 20px;
}
.cure-rate-list {
  width: 100%;
  height: 90%;
}
.alarm-content {
  width: 100%;
  height: 92%;
  display: flex;
  flex-direction: column;
  color: #fff;
  overflow-y: auto;
  //隐藏滚动条背景,但是能看到滚动条为灰色
  &::-webkit-scrollbar {
    width: 8px;
    background-color: transparent;
  }
  &::-webkit-scrollbar-thumb {
    background-color: #7a797962;
    border-radius: 10px;
  }
  &::-webkit-scrollbar-track {
    background-color: transparent;
  }
  &::-webkit-scrollbar-corner {
    background-color: transparent;
  }
}
.alarm-item {
  width: 100%;
  height: 40px;
  display: flex;
  justify-content: space-between;
  color: #e6e3e3;
  font-family: MiroSoft YaHei;
  font-size: 14px;
  font-weight: bold;
  padding: 10px;
  margin-bottom: 10px;
}
.send-email {
  color: #ee0c0c;
  font-family: MiroSoft YaHei;
  font-size: 14px;
  font-weight: bold;
  cursor: pointer;
}
.send-all-email {
  padding: 0 10px;
  height: 30px;
  line-height: 30px;
  color: #fff;
  font-family: MiroSoft YaHei;
  font-size: 14px;
  font-weight: bold;
  cursor: pointer;
}
.cure-top3 {
  width: 100%;
  height: 140px;
  display: flex;
  justify-content: space-around;
  align-items: center;
}
.cure-other {
  width: 100%;
  height: 180px;
  margin-top: 10px;
  padding-bottom: 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  overflow-y: auto;
  //隐藏滚动条背景,但是能看到滚动条为灰色
  &::-webkit-scrollbar {
    width: 8px;
    background-color: transparent;
  }
  &::-webkit-scrollbar-thumb {
    background-color: #7a797962;
    border-radius: 10px;
  }
  &::-webkit-scrollbar-track {
    background-color: transparent;
  }
  &::-webkit-scrollbar-corner {
    background-color: transparent;
  }
}
.cure-blue-bg {
  width: 100px;
  height: 93px;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: center;
  gap: 5px;
  background-image: url('@/assets/patient/home/NO-other.png');
  background-size: 100% 100%;
  background-repeat: no-repeat;
}
.cure-orange-bg {
  width: 100px;
  height: 93px;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: center;
  gap: 5px;
  background-image: url('@/assets/patient/home/NO1.png');
  background-size: 100% 100%;
  background-repeat: no-repeat;
}
.top-title {
  height: 25px;
  font-size: 20px;
  font-weight: bold;
  line-height: 25px;
}
.top1-icon {
  width: 30px;
  height: 30px;
  background-image: url('@/assets/patient/home/NO1-icon.png');
  background-size: 100% 100%;
  background-repeat: no-repeat;
}
.top2-icon {
  width: 30px;
  height: 30px;
  background-image: url('@/assets/patient/home/NO2-icon.png');
  background-size: 100% 100%;
  background-repeat: no-repeat;
}
.top3-icon {
  width: 30px;
  height: 30px;
  background-image: url('@/assets/patient/home/NO3-icon.png');
  background-size: 100% 100%;
  background-repeat: no-repeat;
}
.top-content {
  width: 130px;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: center;
  padding-top: 25px;
}
.hospital-name {
  width: 100%;
  font-size: 14px;
  font-weight: bold;
  color: #fff;
  text-align: center;
  //不换行
  white-space: nowrap;
  //超出部分用省略号表示
  overflow: hidden;
  text-overflow: ellipsis;
}
.cure-item0 {
  width: 410px;
  height: 45px;
  //不压缩
  flex-shrink: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  background: transparent;
}
.cure-item1 {
  width: 410px;
  height: 45px;
  //不压缩
  flex-shrink: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  background: #1d4183;
}
.horn {
  width: 20px;
  height: 20px;
  background-image: url('@/assets/patient/home/horn.png');
  background-size: 100% 100%;
  background-repeat: no-repeat;
}
.other-content {
  width: 330px;
  height: 20px;
  font-size: 14px;
  font-weight: bold;
  color: #fff;
  font-family: MiroSoft YaHei;
  line-height: 20px;
}
.random-chart {
  width: 100%;
  height: 85%;
}
.hight-risk-chart {
  width: 100%;
  height: 83%;
}
.recent-three-add-chart {
  width: 100%;
  height: 91%;
}
.top_map {
  width: 100%;
  display: flex;
  justify-content: space-between;
  z-index: 999;
}
.go_home {
  width: 130px;
  height: 45px;
  text-align: center;
  line-height: 45px;
  font-weight: 400;
  color: #fff;
  font-size: 18px;
  background-image: url('@/assets/patient/home/gohome.png');
  background-size: 100% 100%;
  background-repeat: no-repeat;
  cursor: pointer;
  z-index: 999;
}
.map_name {
  width: 350px;
  height: 45px;
  transform: translateX(-50px);
  line-height: 45px;
  text-align: center;
  position: relative;
  font-weight: 400;
  color: #fff;
  font-size: 18px;
  background-image: url('@/assets/patient/home/map-name.png');
  background-size: 100% 100%;
  background-repeat: no-repeat;
  z-index: 999;
}
.map-chart {
  width: 100%;
  height: 75%;
  position: relative;
  top: -40px;
}
.map_data_display {
  width: 80%;
  height: 160px;
  position: relative;
  top: -50px;
  background-image: url('@/assets/patient/home/content-bg.png');
  background-size: 100% 100%;
  background-repeat: no-repeat;
}
.map_data_content {
  width: 100%;
  height: 75%;
  display: flex;
  justify-content: space-around;
  align-items: center;
}
.map_data_item {
  width: 230px;
  height: 100px;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 30px;
  background-image: url('@/assets/patient/home/data-bg.png');
  background-size: 100% 100%;
  background-repeat: no-repeat;
}
.checking_icon {
  width: 80px;
  height: 80px;
  background-image: url('@/assets/patient/home/checking.png');
  background-size: 100% 100%;
  background-repeat: no-repeat;
}
.confirm_icon {
  width: 80px;
  height: 80px;
  background-image: url('@/assets/patient/home/confirm.png');
  background-size: 100% 100%;
  background-repeat: no-repeat;
}
.patient_icon {
  width: 80px;
  height: 80px;
  background-image: url('@/assets/patient/home/patient.png');
  background-size: 100% 100%;
  background-repeat: no-repeat;
}
.map_text {
  width: 100px;
  height: 60px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  font-size: 16px;
  color: #fff;
  gap: 5px;
}
.map_number {
  font-size: 20px;
  font-weight: bold;
  color: #48a2fc;
  margin-right: 5px;
}
.infinite-list {
  height: 330px;
  padding: 0 5px;
  margin: 0;
  list-style: none;
  //隐藏滚动条背景,但是能看到滚动条为灰色
  &::-webkit-scrollbar {
    width: 8px;
    background-color: transparent;
  }
  &::-webkit-scrollbar-thumb {
    background-color: #7a797962;
    border-radius: 10px;
  }
  &::-webkit-scrollbar-track {
    background-color: transparent;
  }
  &::-webkit-scrollbar-corner {
    background-color: transparent;
  }
}
.alarm-content-item {
  width: 100%;
  display: flex;
  flex-shrink: 1;
  align-items: center;
  justify-content: center;
  background: transparent;
}
.infinite-list .infinite-list-item0 {
  width: 410px;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 50px;
  background: transparent;
}
.infinite-list .infinite-list-item1 {
  width: 410px;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 50px;
  background: #1d4183;
}
.infinite-list .infinite-list-item + .list-item {
}
.alarm-name {
  width: 100px;
  height: 50px;
  line-height: 50px;
  //不换行
  white-space: nowrap;
  //超出部分用省略号表示
  overflow: hidden;
  text-overflow: ellipsis;
}
.alarm-hospital {
  width: 220px;
  height: 50px;
  line-height: 50px;
  //不换行
  white-space: nowrap;
  //超出部分用省略号表示
  overflow: hidden;
  text-overflow: ellipsis;
}
.alarm-idcard {
  width: 220px;
  height: 50px;
  line-height: 50px;
  //不换行
  white-space: nowrap;
  //超出部分用省略号表示
  overflow: hidden;
  text-overflow: ellipsis;
}
.alarm-time {
  width: 190px;
  height: 50px;
  line-height: 50px;
  //不换行
  white-space: nowrap;
  //超出部分用省略号表示
  overflow: hidden;
  text-overflow: ellipsis;
  background: #28e1fa57;
}
.time-box {
  width: 220px;
  display: flex;
  justify-content: center;
  color: #fff;
  font-weight: 400;
  font-size: 14px;
}
.time-bg {
  width: 70px;
  height: 35px;
  text-align: center;
  line-height: 35px;
  background-image: url('@/assets/patient/home/time.png');
  background-size: 100% 100%;
  background-repeat: no-repeat;
  cursor: pointer;
  z-index: 999;
}
.time-active {
  width: 70px;
  height: 35px;
  text-align: center;
  line-height: 35px;
  background-image: url('@/assets/patient/home/time-active.png');
  background-size: 100% 100%;
  background-repeat: no-repeat;
  cursor: pointer;
  z-index: 999;
}
.goback {
  width: 25px;
  height: 25px;
  position: absolute;
  right: 20px;
  transform: translateY(-33px);
  background-image: url('@/assets/patient/home/goback.png');
  background-size: 100% 100%;
  background-repeat: no-repeat;
  cursor: pointer;
}
.middle_bottom {
  width: 100%;
  height: 160px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.random_rate {
  width: 150px;
  height: 150px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  color: #fff;
  font-size: 16px;
  align-items: center;
  position: relative;
  top: -50px;
  background-image: url('@/assets/patient/home/random-rate.png');
  background-size: 100% 100%;
  background-repeat: no-repeat;
}
.random_rate_text {
  width: 100px;
  text-align: center;
}
.random_rate_number {
  width: 100px;
  text-align: center;
  color: #48a2fc;
  font-size: 24px;
  font-weight: bold;
}
.patient_total{
  margin-top: 10px;
  width: 200px;
  color: #ccc;
  font-size: 16px;
  text-align: center;
}
.patient_total_number{
  margin-right: 5px;
  color: #48a2fc;
  font-size: 20px;
  font-weight: bold;
}
</style>
